<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="wf" uri="/augurit-wf"%>

<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/meta_ext.jsp"%>
<%@ include file="/wf/public/meta_wf.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>临时建筑废弃物处置复函</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<style type="text/css">
			.edline
					{
					    BACKGROUND-COLOR: transparent;
					    BORDER-BOTTOM: #a0a0a0 1px solid;
					    BORDER-LEFT: medium none;
					    BORDER-RIGHT: medium none;
					    BORDER-TOP: medium none;
					    FONT-SIZE: 16px
					}
			
			.titleCss{
				font-size:330%;
				text-align:center;
				font-weight: bold;
			}
			.justifyCss{
				width:30%;
				text-align:justify;
				text-justify:distribute-all-lines;
				text-align-last:justify;
			}
			.tdCss{
				font-size:200%;
				font-weight: bold;
			}
			.inputNoborder {
			    FONT-SIZE: 30px;
			    FONT-FAMILY: 宋体;
			    BORDER-RIGHT: #FFFFFF 1px solid;
			    BORDER-TOP: #FFFFFF 1px solid;
			    BORDER-LEFT: #FFFFFF 1px solid;
			    BORDER-BOTTOM: #FFFFFF 1px solid;
			}
		</style>
		  <script src="${ctx}/resources/js/ext/adapter/ext/ext-base.js" type="text/javascript"></script>
         <script src="${ctx}/resources/js/ext/ext-all.js" type="text/javascript"></script>
         <script src="${ctx}/common/apabiPrint/js/gaizhang.js" type="text/javascript"></script>
         <script src="${ctx}/resources/js/jquery/jquery.js" type="text/javascript"></script>
         <script src="${ctx}/gzcgwsp/resources/js/YwUtil.js" type="text/javascript"></script>
	</head>
	<script type="text/javascript">
          Ext.onReady(function(){
            var hjmc=document.getElementById("hjmc").value;
            if (hjmc=="fz"){//经办人办结改变
             // document.getElementById("printzs").style.display='none';
              document.getElementById("savezs").style.display='block';
              for (var i = 0; i < document.forms[0].elements.length; i++) {
                    var element = document.forms[0].elements[i];
                    if(element.name !="zsbh" && element.name !="jyfw" && element.name !="endyear" && element.name !="endmonth" && element.name !="endday" && element.name !="startyear" && element.name !="startmonth" && element.name !="startday" ){
                     element.readOnly= true; 
                    }
               }
            }else if(hjmc=="dzgz"){//打印设置为不可编辑
              document.getElementById("printzs").style.display='block';
             // document.getElementById("savezs").style.display='none';
              for (var i = 0; i < document.forms[0].elements.length; i++) {
                    var element = document.forms[0].elements[i];
                     element.readOnly= true; 
               }
            } 
         });
        
        function printFh(){//点击【打印】按钮
        	var zsbh=document.getElementById("zsbh").value;
        	if(zsbh==""){
        		alert("请输入证书编号并保存");
        		return;
        	}
        	var templateCode = '${templateCode}';
        	var url;
        	//if(templateCode == 'jzfqwczzpf_xz'){//新增
        		url = '${ctx}/yw-yn-jzfqwczz-pfsn!printcz.action?id='+${id} + '&templateCode='+templateCode+'&fileCode=xzxkjds&taskInstDbid=' + ${taskInstDbid};
        	/*}else if(templateCode == 'jzfqwczzpf_bg'){//变更
        		url = '${ctx}/yw-yn-jzfqwczz-pfsnbg!printcz.action?id='+${id} + '&templateCode='+templateCode+'&fileCode=xzxkjds&taskInstDbid=' + ${taskInstDbid};
        	}else{//延期
        		url = '${ctx}/yw-yn-jzfqwczz-pfsnyq!printcz.action?id='+${id} + '&templateCode='+templateCode+'&fileCode=xzxkjds&taskInstDbid=' + ${taskInstDbid};
        	}*/
            //var url = '${ctx}/yw-yn-jzfqwczz-pfsn!printcz.action?id='+${id} + '&templateCode=jzfqwczzpf_xz&fileCode=xzxkjds&taskInstDbid=' + ${taskInstDbid};
             YwUtil.openWin({url: url});
            //window.open(url,100, 650);
        }
          //盖章许可证
		function gzxkz(){
           		var url = '${ctx}/yw-yn-jzfqwczz-pfsn!gzDoc.action?id=${id}&templateCode=${templateCode}&fileCode=xzxkjds&taskInstDbid=${taskInstDbid}';
	       		window.open(url);
           
         }
           //查看盖章
		 function viewgzJyxkzs(){
		 	   var filename = document.getElementById("sqdw").value+
		          document.getElementById("acceptNo").value+"许可证.doc";
		       var params="filename="+filename;   
		       var id=document.getElementById("id").value;
		       var templateCode='${templateCode}';
		       var url="${ctx}/yw-com-print!veiwGzfile.action?ywId="+id+"&templateCode="+templateCode;
		 	   $.ajax({
					url : url,
					type : "post",
					dataType : "html",
					data : params,
					success : function(msg) {
						   if(msg!=""){
					        	 filename=filename.substring(0,filename.lastIndexOf("."));
								filename+=".ceb";
								filename=encodeURI(encodeURI(filename));
								window.location.href = "${ctx}/common/downloadfile.jsp?filepath="+msg+"&filename="+filename;  
							}else{
								alert('文件不存在！');
							}
					},
					error:function() {
						alert("添加失败！请刷新重试！");
					}
				});
		 	   
		 }
        function saveFh2(){
        	var templateCode = '${templateCode}';
        	var url;
        	if(templateCode == 'jzfqwczzpf_xz'){//新增
        		url = '${ctx}/yw-yn-jzfqwczz-pfsn!saveFh.action';
        	}else if(templateCode == 'jzfqwczzpf_bg'){//变更
        		url = '${ctx}/yw-yn-jzfqwczz-pfsnbg!saveFh.action';
        	}else{//延期
        		url = '${ctx}/yw-yn-jzfqwczz-pfsnyq!saveFh.action';
        	}
            var datenow = new Date();
           	Ext.Ajax.request({
              method:'post',
              url:url,
              params:{
                'id':document.getElementById("fhId").value,
                'zsbh':document.getElementById("zsbh").value,
                'fhGd':document.getElementById("fhGd").value,
                'orgFile':document.getElementById("orgFile").value,
                'zsrq':datenow,
                 'zsksrq':document.getElementById("zsksrq").value,
                'zsjsrq':document.getElementById("zsjsrq").value,
                 'zforg':document.getElementById("zforg").value,
                 'areazfj':document.getElementById("areazfj").value,
                 'areaorg':document.getElementById("areaorg").value,
                'fhYfrq':document.getElementById("fhYfrq").value
              },
              success:function(response){
                 var result=response.responseText;
                 if(result=="true"){                
                       alert("保存成功");
                 }else{
                     alert("保存失败！");
                 }
              },
              failure: function() {
                alert("保存失败！");
             }, 
              scope:this
           });
            
        }

        </script>
	<body>
		<form action="yw-yn-jzfqwczz-pfsn!printnewJyxkz.action" method="POST" target="autoPrintIFrame">
		<input type="hidden" name="id" id="fhId" value="${id}"/>
		<input type="hidden" name="sqdw" id="sqdw" value="${sqdw}"/>
		<input type="hidden" name="acceptNo" id="acceptNo" value="${acceptNo}"/>
		<input type="hidden" name="hjmc" id="hjmc" value="${request.activName}"/>
		<table width="800" border=0 align="center">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td class="titleCss">广州市余泥处渣土排放管理处</td>
			</tr>
		</table>
		<hr width="55%">
		<hr width="55%">
		<table width="700" border=0 align="center">
			<tr>
				<td align="right" style="font-size:120%;letter-spacing:4px;">穗${orgjc}临处置函第&nbsp;<input name="zsbh" id="zsbh" value="${zsbh }" class="inputNoborder" style="FONT-SIZE: 20px;width:150px;"/>&nbsp;号</td>
			</tr>
			<tr>
				<td align="center" style="font-size:200%;">&nbsp;</td>
			</tr>
			<tr>
				<td align="center" style="font-size:200%;font-weight: bold;">临时建筑废弃物处置复函</td>
			</tr>
			<tr>
				<td align="center" style="font-size:200%;">&nbsp;</td>
			</tr>
			<tr>
				<td align="left" style="font-size:120%;letter-spacing:4px">${sqdw}:</td>
			</tr>
			<tr>
				<td align="left" style="font-size:120%;letter-spacing:4px;line-height:30px;FONT-FAMILY: 宋体;">
					&nbsp;&nbsp;&nbsp;根据广州市人民政府《广州市重点项目报批绿色通道若干规定》（穗府[2012]16号）及
					<input type="text" name="orgFile" id="orgFile" size="120" value="${orgFile} " type="text" class="edline" />
						精神，同意你单位在${gcdz} 的${gcmc}工程,对外排放建筑废弃物。
					处置有效期从<input type="text" name="zsksrq" class="edline" id="zsksrq"  style="width:150px" value="<s:date name='zsksrq' format="yyyy年MM月dd日"/>" onclick="WdatePicker({skin:'ext', dateFmt:'yyyy年MM月dd日'});" type="text" class="textdocWdate" readonly/>
					
					</font>至
					<input type="text" name="zsjsrq" id="zsjsrq" class="edline" style="width:150px" value="<s:date name='zsjsrq' format="yyyy年MM月dd日"/>" onclick="WdatePicker({skin:'ext', dateFmt:'yyyy年MM月dd日'});" type="text" class="textdocWdate" readonly/>
					</font>
					止。
					承运建筑废弃物的公司是<font style="text-decoration:underline">${ysgs}</font>,建筑废弃物运输监督专员：${ysdwjdy },电话：${ysdwjdydh }。施工单位：${sgdwGz }
					,建筑废弃物排放监督专员：${sgdwjdy },电话${sgdwjdydh }。
					<br/>&nbsp;&nbsp;&nbsp;请贵单位在处置建筑废弃物过程中，严格遵守如下规定：
					<br/>
					<textarea name="fhGd" id="fhGd" rows="20" style="font-size:90%;letter-spacing:4px;line-height:30px;FONT-FAMILY: 宋体;width:700">${fhGd}</textarea>
				</td>
			</tr>
			<tr>				
				<td align="right" style="font-size:120%;">
					<br/><br/><br><br/></br>${fhYfrqStr }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>
				</td>
			</tr>
			<tr>
				<td align="left" style="font-size:150%;font-weight: bold;">
					主题词：城乡建设&nbsp;&nbsp;城市管理&nbsp;&nbsp;复函
					<hr width="100%" color="black">
				</td>
			</tr>
			<tr>
				<td align="left" style="font-size:120%;letter-spacing:4px;line-height:30px;FONT-FAMILY: 宋体;">
					抄送：
					<input type="text" name="zforg" id="zforg" size="30" value="${zforg} " type="text" class="edline" />
					<input type="text" name="areazfj" id="areazfj" size="30" value="${areazfj} " type="text" class="edline" />
					<input type="text" name="areaorg" id="areaorg" size="30" value="${areaorg} " type="text" class="edline" />

					<hr width="100%" color="black">
				</td>
			</tr>
			<tr>
				<td align="left" style="font-size:120%;letter-spacing:4px;line-height:30px;FONT-FAMILY: 宋体;">
					
					${orgname }  
					
					
					<input name="fhYfrq" value="<s:date name='fhYfrq' format="yyyy年MM月dd日"/>" class="edline"  type="text" style="width:180" onclick="WdatePicker({skin:'ext', dateFmt:'yyyy年MM月dd日'});" class="textdocWdate"/>
					印发
					<hr width="100%" color="black">
				</td>
			</tr>
			<tr>
				<td align="left" style="font-size:120%;letter-spacing:4px;line-height:30px;FONT-FAMILY: 宋体;">
					&nbsp;
				</td>
			</tr>			
			<tr>
				<td align="center" style="font-size:120%;letter-spacing:4px;line-height:30px;FONT-FAMILY: 宋体;">
					<input type="button" id="saveFh" onclick="saveFh2();" value="保&nbsp;&nbsp;存" style="width:100px;"/> 
					<input type="button" onclick="printFh();"  id="printzs" value="打&nbsp;&nbsp;印" style="width:100px;"/>
					<input type="button" onclick="gzxkz();"  id="gzdoc" value="盖&nbsp;&nbsp;章" style="width:100px;"/>
					 <input type="button" onclick="viewgzJyxkzs();"  id="viewgzfile" value="查看盖章" style="width:100px;"/>
					  
				</td>
			</tr>
			<tr>
				<td align="center" style="font-size:120%;letter-spacing:4px;line-height:30px;FONT-FAMILY: 宋体;">
					&nbsp;
				</td>
			</tr>
		</table>
		
		
		</form>
		<div id="autoPrintDiv" style="display:none;"><iframe height='1000' width='700' name='autoPrintIFrame'/></div>
	</body>
</html>